package roledto

import (
	"github.com/gogf/gf/v2/util/gconv"
	"strconv"
	"xr-game-server/entity"
)

type RoleDto struct {
	RoleId   string `json:"roleId"`
	ServerId uint32 `json:"serverId"`
	Nick     string `json:"nick"`
}

func NewRoleDto(role *entity.PlayerRole) *RoleDto {
	ret := new(RoleDto)
	ret.RoleId = strconv.FormatUint(role.ID, 10)
	gconv.Struct(role, ret)
	return ret
}
